//
//  PicDetailTVCell.m
//  OpenEyes
//
//  Created by dllo on 15/9/15.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "PicDetailTVCell.h"
#import "PicDetailModel.h"
@implementation PicDetailTVCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.img = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, H * 250)];
        [self.contentView addSubview:self.img];
        
        
        
        self.titleLbl = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH / 4, H * 265, WIDTH / 2,H * 30)];
        self.titleLbl.textAlignment = 1;
        [self.contentView addSubview:self.titleLbl];
        
        
        
        self.lbl = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH / 4, H * 300, WIDTH / 2, H * 20)];
        self.lbl.textAlignment = 1;
        self.lbl.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.lbl];
        
        
        
        self.blackView = [[UIView alloc]initWithFrame:CGRectMake(0, H * 330, WIDTH, 10)];
        self.blackView.backgroundColor = [UIColor colorWithWhite:0.220 alpha:1.000];
        [self addSubview:self.blackView];
        
    }
    return self;
}



-(void)getVuale:(PicDetailModel *)model
{
    [self.img sd_setImageWithURL:[NSURL URLWithString:model.coverImage] placeholderImage:nil];
    self.titleLbl.text = model.title;
    self.lbl.text = [NSString stringWithFormat:@"%@ / %@",model.producter,model.category];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
